//
//  HNSH_BusinessCircleDetailHeaderView.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/3/6.
//

#import "HNSH_BusinessCircleDetailHeaderView.h"

@interface HNSH_BusinessCircleDetailHeaderView ()

/* imgV */
@property (nonatomic, strong) UIImageView *imgV;
/* titleLabel */
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation HNSH_BusinessCircleDetailHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self configUI];
    }
    return self;
}

- (void)setModel:(HNSH_BusinessCircleListModel *)model {
    _model = model;
    [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.image_url]];
    self.titleLabel.text = model.name;
}

- (void)configUI {
    [self addSubview:self.imgV];
    [self addSubview:self.titleLabel];
}

#pragma mark lazy
- (UIImageView *)imgV {
    if (!_imgV) {
        _imgV = [[UIImageView alloc]initWithFrame:CGRectMake(16, 12, kScreenWidth-32, 193)];
    }
    return _imgV;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(16, 225, 200, 28)];
        _titleLabel.text = @"华联超市";
        _titleLabel.textColor = [UIColor appBlackLabelColor];
        _titleLabel.font = [UIFont boldSystemFontOfSize:20];
    }
    return _titleLabel;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
